<template>
  <div class="wallet">
    <Header></Header>
    <div class="w clearfix">
      <Breadcrumb :breadcrumbs="breadcrumbs" />
      <div class="walletListTitle">
        <ul>
          <li v-for="(item,index) in data" :class="(index === key )?active:''" :key="index" @click="to(item,index)">
            <u class="iconfont" v-html="item.ico"></u>{{$t(item.titleKey)}}
            <i></i>
          </li>
        </ul>
      </div>
      <div class="walletContent">
        <router-view></router-view>
      </div>
    </div>
    <Footer></Footer>
  </div>
</template>
<script>
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import Breadcrumb from '@/components/Breadcrumb';

export default {
  name: 'wallet',
  data() {
    return {
      data: [
        { titleKey: 'router.walletlist', path: '/wallet/walletlist', ico: '&#xe646;' },
        { titleKey: 'router.address', path: '/wallet/address', ico: '&#xe603;' },
        { titleKey: 'router.setup', path: '/setup', ico: '&#xe874;' },
      ],
      breadcrumbs: [{
        path: '/',
        titleKey: 'router.home',
      }, {
        path: '/wallet',
        titleKey: 'router.walletlist',
      }],
      active: 'active',
      key: 0,
    };
  },
  components: {
    Header,
    Footer,
    Breadcrumb,
  },
  created() {
    this.breadcrumbs[1].path = this.$route.fullPath;
  },
  watch: {
    '$route.fullPath': {
      handler(value) {
        this.breadcrumbs[1].path = value;
      },
    },
  },
  methods: {
    to(item, index) {
      this.$router.push(item.path);
      this.breadcrumbs[1].title = item.title;
      this.key = index;
    },
  },
};
</script>
<style scoped>

.wallet .walletListTitle {
  width: 212px;
  background-color: #ffffff;
  padding: 30px 0;
  box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.05);
  border: solid 1px #e0e0e0;
  margin-right: 18px;
  height: auto;
  float: left;
  border-radius: 5px;
  box-sizing: border-box;
}
.wallet .walletListTitle ul li {
  padding-left: 50px;
  font-size: 18px;
  line-height: 80px;
  height: 80px;
  position: relative;
  cursor: pointer;
}

.active {
  color:#70c1b3;
}
.active i {
  background-color: #70c1b3;
}
/* .wallet .walletListTitle ul li:active{

} */
.wallet .walletListTitle ul li u {
  font-style: normal !important;
  font-size: 24px;
  position: absolute;
  top: 49%;
  transform: translateY(-50%);
  left: 20px;
  text-decoration: none;
}
.wallet .walletListTitle ul li i {
  width: 4px;
  height: 18px;
  /* background-color: red; */
  display: block;
  font-style: normal;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 18px;
}
.wallet .walletListTitle ul li:hover {
  color: #70c1b3;
}
.wallet .walletListTitle ul li:hover i {
  background-color: #70c1b3;
}

.wallet .walletListTitle .el-menu {
  border-right: none;
}
.wallet .walletContent {
  min-width: 710px;
  width: 930px;
  float: left;
  /* min-height: 500px; */
  font-size: 18px;
  color: #333333;
  box-sizing: border-box;
  line-height: 24px;
  text-align: center;
  border-radius: 5px;
}
</style>
